import { ObjCreate } from "../ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { Language } from "../../../../../extend/language/Language";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
type int = number;
//class RepairCostTooltip
    
    export  class RepairCostTooltip /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.initUI();
            return;
        }

        /* internal  */initUI(): void
        {
            this._fire1 = ObjCreate.createBitmap(ImagesConst.Fire, this._left, 10, this);
            this._fire2 = ObjCreate.createBitmap(ImagesConst.Fire, this._left, 10, this);
            this._coin1 = ObjCreate.createBitmap(ImagesConst.Tongqian_bind_small, this._left, 10, this);
            this._coin2 = ObjCreate.createBitmap(ImagesConst.Tongqian_bind_small, this._left, 10, this);
            this._labelEquip = ObjCreate.createGTextField(Language.getString(90283), this._left + 25, 10, 200, 20, this);
            this._labelEquip.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._labelPetEquip = ObjCreate.createGTextField(Language.getString(90284), this._left + 25, 10, 200, 20, this);
            this._labelPetEquip.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._costEquip = ObjCreate.createGTextField("", this._left + 25, 10, 200, 20, this);
            this._costEquip.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._costPetEquip = ObjCreate.createGTextField("", this._left + 25, 10, 200, 20, this);
            this._costPetEquip.autoSize = flash.text.TextFieldAutoSize.LEFT;
            return;
        }

        public set data(arg1: Object)
        {
            if (!arg1) 
            {
                return;
            }
            this._costEquip.htmlText = HTMLUtil.addColor(arg1["costEquip"] + "", GlobalStyle.color1);
            this._costPetEquip.htmlText = HTMLUtil.addColor(arg1["costPetEquip"] + "", GlobalStyle.color1);
            this.updatePosition();
            return;
        }

        /* internal  */updatePosition(): void
        {
            var loc1=0;
            loc1 = 0;
            this._fire1.y = loc1;
            this._labelEquip.y = loc1 + 6;
            loc1 = loc1 + (this._labelEquip.height + 6);
            this._costEquip.y = loc1;
            this._coin1.x = this._costEquip.x + this._costEquip.width + 5;
            this._coin1.y = loc1 + 2;
            loc1 = loc1 + this._costEquip.height;
            this._fire2.y = loc1;
            this._labelPetEquip.y = loc1 + 6;
            loc1 = loc1 + (this._labelPetEquip.height + 6);
            this._costPetEquip.y = loc1;
            this._coin2.x = this._costPetEquip.x + this._costPetEquip.width + 5;
            this._coin2.y = loc1 + 2;
            loc1 = loc1 + this._costPetEquip.height;
            return;
        }

        public /* override */ get width(): number
        {
            return 140;
        }

        /* internal */ /* var */_left: int=2;

        /* internal */ /* var */_fire1: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_fire2: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_coin1: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_coin2: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_labelEquip: GTextFiled;

        /* internal */ /* var */_labelPetEquip: GTextFiled;

        /* internal */ /* var */_costEquip: GTextFiled;

        /* internal */ /* var */_costPetEquip: GTextFiled;
    }
